﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MissionEditor.EventUI
{
    public partial class RevealMap : UserControl, IEventUI
    {
        Event activeEvent;
        public RevealMap(Event activeEvent)
        {
            this.activeEvent = activeEvent;
            InitializeComponent();

            xTextBox.Text = BitConverter.ToUInt32(activeEvent.raw, 0).ToString();
            yTextBox.Text = BitConverter.ToUInt32(activeEvent.raw, 4).ToString();
            radiusTextBox.Text = BitConverter.ToUInt32(activeEvent.raw, 14).ToString();
        }
        public void Apply()
        {
            BitConverter.GetBytes(Convert.ToUInt32(xTextBox.Text)).CopyTo(activeEvent.raw, 0);
            BitConverter.GetBytes(Convert.ToUInt32(yTextBox.Text)).CopyTo(activeEvent.raw, 4);
            BitConverter.GetBytes(Convert.ToUInt32(radiusTextBox.Text)).CopyTo(activeEvent.raw, 14);
        }
    }
}
